<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>table模块快速使用</title>
    <link rel="stylesheet" href="./plugins/layui/css/layui.css" media="all">
</head>

<body>

    <table id="demo" lay-filter="test"></table>

    <script src="./plugins/layui/layui.js"></script>
    <script>
        layui.use('table', function () {
            var table = layui.table;
            //执行渲染
            table.render({
                elem: '#demo' //指定原始表格元素选择器（推荐id选择器）
                , height: 315 //容器高度
                , cols: [[ //标题栏
                    { checkbox: true }
                    , { field: 'id', title: 'ID', width: 80 }
                    , { field: 'username', title: '用户名', width: 120 }
                ]]
                , url: '/table.json', page: true, limit: 1, id: 'idTest', height: 'full-75',
                response: {
                    statusName: 'Code',
                    statusCode: 200,
                    msgName: 'Message',
                    countName: 'Total',
                    dataName: 'Data'
                }
            });
        });
    </script>
</body>

</html>